home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Libris Britannia 4
/
science library(b).zip
/
science library(b)
/
PROGRAMM
/
CC_C
/
0151.ZIP
/
IFSWITCH.ASM
< prev
next >
Wrap
Assembly Source File
|
1985-02-07
|
714b
|
46 lines
title "If Switch" MSDOS Batch Utility
name ifsw
;
;Syntax is:
;
;ifswitch <1,2>
;if errorlevel 1 goto ...
;
;tests for the specified switch being up. If 3
;is specified, it means if either switch is up.
;
code segment
assume cs:code,ds:code
org 005ch
tfcb label byte
org 0100h
main: mov ax,0e000h ;MC85 segment,
mov es,ax
mov bx,0f801h ;BITS location,
mov al,es:[bx] ;sample BITS,
mov bl,tfcb + 1 ;get 1,2 parm,
and bx,0003h ;strip it,
mov ah,cs:bittbl[bx];make test patt
and al,ah ;and with bits
jz m1
mov al,1
m1: mov ah,76
int 21h ;terminate
;
;bits are backwards in the MC85
;
bittbl label byte
db 00
db 02
db 01
db 03
code ends
end main